/**
  ******************************************************************************
  * @file    CFG_SetTimeOutSocket.c
  * @author  exatron
  * @version V1.0.0
  * @date    segunda, 22 de dezembro de 2014
  * @brief   Seta o timeout para sockets.
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */

/**
  * @addtogroup CFG
  * @{
  */

/* Includes ------------------------------------------------------------------*/
#include <common.h>

extern int timeout_socket;

/* External functions --------------------------------------------------------*/

/**
  * @defgroup CFG_Functions
  * @{
  */

/**
  * @brief  Seta o timeout do socket.
  * @param  int timeout
  * @retval Devolve pela serial Result_t
  */
void CFG_SetTimeOutSocket(int timeout)
{
	if(timeout == 0)
	{
		aux_CFG_SetTimeOutSocket(65335);
		timeout_socket = 65335;
	}
	else
	{
		aux_CFG_SetTimeOutSocket(timeout);
		timeout_socket = timeout;
	}

	aux_USART0_puts("%s=%d\r\n", "CFG_STOS", Result_Ok);

	aux_SetBusy(FALSE);
}

/**
  * @}
  */

/**
  * @}
  */


